<html lang="en">
<head>
    <title>注册游记管理</title>
<#include  "../common/header.ftl">

    <script>
        $(function () {
            //重新发布
            $(".state").click(function () {
                var tid = $(this).data("tid");
                var state = $(this).data("state");
                console.log(state);
                console.log(tid);
                $.get("/travel/changeState.do", {state: state, id: tid}, function (data) {
                    if (data.success) {
                        window.location.reload();
                    }
                })
            })
            //查看内容-------------------------------
            $(".lookBtn").click(function () {
                var id = $(this).data("tid");
                console.log(id);
                //查询游记内容
                $.get("/travel/getTravelContent.do",{id:id}, function (data) {
                    console.log(data);
                    //设置游记内容
                    $("#travelModal .content").html(data.content);
                })
                $(".modal").modal("show");
            })
            //end-----------------------------------
        })
    </script>
    <style>
        #travelModal img{
            width: 100%;
        }
        #travelModal .modal-body{
            max-height: 600px;
            overflow-y: auto;
        }
    </style>
</head>
<body>
<!--左侧菜单回显变量设置-->
<#assign currentMenu='reject'>


<div class="container " style="margin-top: 20px">
<#include  "../common/top.ftl">
    <div class="row">
        <div class="col-sm-2">
        <#include  "../common/menu.ftl">
        </div>
        <div class="col-sm-10">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">已拒绝游记管理</h1>
                </div>
            </div>
            <!--高级查询--->
            <form class="form-inline" id="searchForm" action="/travel/reject.do" method="post">
                <input type="hidden" name="currentPage" id="currentPage" value="1">
                <div class="form-group">
                    <label for="keyword">关键字:</label>
                    <input type="text" class="form-control" id="keyword" name="keyword" value="${qo.keyword!}"
                           placeholder="请输入昵称/邮箱">
                </div>
                <button id="btn_query" class="btn btn-info"><span class="glyphicon glyphicon-search"></span> 查询</button>
            </form>

            <table class="table table-striped table-hover">
                <thead>
                <th>编号</th>
                <th>标题</th>
                <th>封面</th>
                <th>地点</th>
                <th>作者</th>
                <th>状态</th>
                <th>操作</th>
                </tr>
                </thead>

            <#list result.list as entity>
                <tr>
                    <td>${entity_index + 1}</td>
                    <td>${(entity.title)!}</td>
                    <td><img src="${entity.coverUrl!}" width="40px"></td>
                    <td>${(entity.place.name)!}</td>
                    <td>${(entity.author.nickName)!}</td>
                    <td>${(entity.stateDisplay)!}</td>
                    <td>
                        <a href="javascript:;" data-state="1" data-tid="${entity.id}" class="state">恢复</a>&nbsp;&nbsp;
                        <a href="javascript:;" class="lookBtn" data-tid="${entity.id}" >查看内容</a>&nbsp;
                    </td>
                </tr>
            </#list>

            </table>
        <#include "../common/page.ftl">
        </div>
    </div>
</div>


<#--查看内容模态框-->
<div id="travelModal" class="modal" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">查看内容</h4>
            </div>
            <div class="modal-body content">
            </div>
            <div class="modal-footer">
                <a href="javascript:void(0);" class="btn" data-dismiss="modal" aria-hidden="true">关闭</a>
            </div>
        </div>
    </div>
</div>
</body>
</html>